<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!--{include file='comm/header.tpl'}-->
    <!--{if $role_group_array}-->
    <title>角色组修改</title>
    <!--{else}-->
    <title>角色组新增</title>
    <!--{/if}-->
</head>
<body>
	<div style="width:100%">
		
		<div class="items clearfix">
			<h2 style="" class="tal">
                <!--{if $role_group_array}-->
                    正在操作：角色组修改
                <!--{else}-->
                    正在操作：角色组新增
                <!--{/if}-->
			</h2>
			
			<div class="items2">

				<form id="addForm" onsubmit="return false;">
					<table>
						<tr>
							<td width="150" class="tar">角色组名称：</td>
							<td width="*">
								<input type="text" style="width:200px" id="roleGroupName" name="roleGroupName" value="<!--{$role_group_array.roleGroupName}-->">
								<input type="hidden" id="roleGroupID" name="roleGroupID" value="<!--{$role_group_array.roleGroupID}-->">
                                <span class="red">*</span>
							</td>
						</tr>
						<tr>
							<td class="tar">备注：</td>
							<td>
								<textarea id="memo" name="memo" cols="60" rows="3"><!--{$role_group_array.memo}--></textarea>
							</td>
						</tr>
					</table>
				</form>
				
			</div>
		</div>
		
		<div class="bottom_fixbox">
			<div class="rectbox tac">
                <input type="button" class="btn" onclick="roloGroup.check();" value="保存">
				<input type="button" class="btn" onclick="E.closeWindows();" value="关闭">
	        </div>
		</div>

	</div>

<script type="text/javascript">

    var roloGroup = {

        dt: "",

        id: <!--{$role_group_array.roleGroupID|default:0}-->,

        check: function() {

            this.dt = E.getFormValues("addForm");

            if (E.isEmpty(this.dt.roleGroupName)) {
                E.alert("请输入角色组名称");
            } else {
                E.ajax_get({
                    url: "/invokingAjax-backend/user/roleGroupList.ajax?operFlg=2",
                    data: this.dt,
                    call: "roloGroup.result"
                });
            }

        },

        result: function( o ) {

            if (o.code == 200) {
                E.opener("roleGroup.load");
                if (this.id == 0) {
                    E.alert("角色组保存成功", 2, "E.refresh");
                } else {
                    E.alert("角色组保存成功", 2, "E.closeWindows");
                }
            } else {
                E.alert(o.message);
            }

        }

    };

</script>

</body>
</html>